#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
class B {
public:
	B(int m) {
		a = m;
	}
	~B() {
		a = 0;
	}
private:
	int a;
};
class A {
public:
	A(int x=1,int y=1,int z=1) 
		:a(x)
		,b(y)
		,c(z)
		,d(1)
	{
		cout << "A()" << endl;
	}
private:
	int a;
	const int b;
	int& c;
	B d;
};
class d {
public:
	void print() {
		cout << a << endl;
	}
	static int p() {
		return a;
	}
private:
	static int a;
};
int d::a = 2;
class C {
public:
	friend class D;
	C(int x = 1, int y = 1)
		:a(x),
		b(y)
	{

	}
	int p() {
		return a;
	}
private:
	int a=1;
	int b=1;
};
class D {
	
public:
	
	D() {
		cout << C().p() << endl;
	}
};
class list {
public:
	class R {
	public:
		R(int a=1)
		:x(a){
			
		}
		int p() {
			return x;
		}
	private:
		int x = 1;
	};
private:
	int a;
};
int main() {
	/*list d;
	list::R a(2);*/
	cout << C().p() << endl;
}